package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TBookStorageInfoMapper;
import com.ruoyi.system.domain.TBookStorageInfo;
import com.ruoyi.system.service.ITBookStorageInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 图书上架Service业务层处理
 * 
 * @author zhaowq
 * @date 2022-06-08
 */
@Service
public class TBookStorageInfoServiceImpl implements ITBookStorageInfoService 
{
    @Autowired
    private TBookStorageInfoMapper tBookStorageInfoMapper;

    /**
     * 查询图书上架
     * 
     * @param id 图书上架主键
     * @return 图书上架
     */
    @Override
    public TBookStorageInfo selectTBookStorageInfoById(Long id)
    {
        return tBookStorageInfoMapper.selectTBookStorageInfoById(id);
    }

    /**
     * 查询图书上架列表
     * 
     * @param tBookStorageInfo 图书上架
     * @return 图书上架
     */
    @Override
    public List<TBookStorageInfo> selectTBookStorageInfoList(TBookStorageInfo tBookStorageInfo)
    {
        return tBookStorageInfoMapper.selectTBookStorageInfoList(tBookStorageInfo);
    }

    /**
     * 新增图书上架
     * 
     * @param tBookStorageInfo 图书上架
     * @return 结果
     */
    @Override
    public int insertTBookStorageInfo(TBookStorageInfo tBookStorageInfo)
    {
        tBookStorageInfo.setCreateTime(DateUtils.getNowDate());
        return tBookStorageInfoMapper.insertTBookStorageInfo(tBookStorageInfo);
    }

    /**
     * 修改图书上架
     * 
     * @param tBookStorageInfo 图书上架
     * @return 结果
     */
    @Override
    public int updateTBookStorageInfo(TBookStorageInfo tBookStorageInfo)
    {
        tBookStorageInfo.setUpdateTime(DateUtils.getNowDate());
        return tBookStorageInfoMapper.updateTBookStorageInfo(tBookStorageInfo);
    }

    /**
     * 批量删除图书上架
     * 
     * @param ids 需要删除的图书上架主键
     * @return 结果
     */
    @Override
    public int deleteTBookStorageInfoByIds(String ids)
    {
        return tBookStorageInfoMapper.deleteTBookStorageInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除图书上架信息
     * 
     * @param id 图书上架主键
     * @return 结果
     */
    @Override
    public int deleteTBookStorageInfoById(Long id)
    {
        return tBookStorageInfoMapper.deleteTBookStorageInfoById(id);
    }
}
